<script>
   var strs = ["America","Greece","Britain","Canada","China","Egypt"];
   var amount = 0;
   document.write("在以下字符串中：<br/>")
   for(var i=0;i<strs.length;i++){
       if(strs[i].indexOf("a")!=-1||strs[i].indexOf("A")!=-1){
            amount++;
       }
       document.write(strs[i]+"<br/>");
   }
   document.write("共有"+amount+"个字符串含有a或A");
   
</script>